home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ClockGbl.h
-
- Contains: xxx put contents here xxx
-
- Owned by: Richard Rodseth
-
- Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <11> 10/23/95 RR #1291688 Added test for adding New menus
- <10> 10/13/95 EL 1287340: Use standard ISO prefix
- <9> 9/12/95 RR Various activation problems. Added a
- floating window
- <8> 9/4/95 TJ Added Includes to Compile with out
- PC-Headers.
- <7> 9/1/95 RR # 1244639 Added fDisplaySettingsDialog &
- RemovingFrame()
- <6> 7/10/95 RR Misc. cleanup and bug fixes for shared
- window
- <5> 7/7/95 RR Some refactoring. Fix
- CreatePropObjSpecifier to deal with
- non-persistent frame. Set source frame of
- dialogs.
- <4> 6/30/95 RR 1242642 BB Ref counting fixes. Display
- settings window is saved as an ID, not a
- window
- <3> 6/3/95 TJ Added #includes for compile with out PCH
- <2> 6/1/95 RR Removed "static"
- <1> 5/31/95 RR first checked in
-
- To Do:
- */
-
- #ifndef _CLOCKGBL_
- #define _CLOCKGBL_
-
- #ifndef SOM_ODSession_xh
- #include <ODSessn.xh>
- #endif
-
- #ifndef __DIALOGS__
- #include "Dialogs.h"
- #endif
-
- #ifndef SOM_ODMenuBar_xh
- #include <MenuBar.xh>
- #endif
-
- #ifndef SOM_ODWindowState_xh
- #include <WinStat.xh>
- #endif
-
- #ifndef _ODTYPES_
- #include <ODTypes.h>
- #endif
-
- //=========================================================================
- // Classes Defined Here
- //=========================================================================
-
- class ClockGlobals;
-
- //=========================================================================
- // Classes Used Here
- //=========================================================================
-
- class OrderedCollection;
-
- //=========================================================================
- // Global Data
- //=========================================================================
-
- extern ClockGlobals* gClockGlobals;
-
- //=========================================================================
- // Function Prototypes
- //=========================================================================
-
- pascal Boolean ClockDialogFilter(DialogPtr dialog,
- EventRecord* event,
- short* itemHit);
- pascal Boolean AboutDialogFilter(DialogPtr dialog,
- EventRecord* event,
- short* itemHit);
-
- //=========================================================================
- // Constants
- //=========================================================================
-
- #define kCPIdleFrequency 20
-
- const ODPropertyName kPropClockType = "+//ISO 9070/ANSI::113722::US::CI LABS::Apple:TestClock:Property:Type";
- const ODPropertyName kPropClockFont = "+//ISO 9070/ANSI::113722::US::CI LABS::Apple:TestClock:Property:Font";
- const ODPropertyName kPropClockStyle = "+//ISO 9070/ANSI::113722::US::CI LABS::Apple:TestClock:Property:Style";
- const ODPropertyName kPropClockSize = "+//ISO 9070/ANSI::113722::US::CI LABS::Apple:TestClock:Property:Size";
-
- // To identify different frames
-
- const ODType kClockFrame = "+//ISO 9070/ANSI::113722::US::CI LABS::Apple:TestClock:Presentation:Time";
- const ODType kSynchronizeFrame = "+//ISO 9070/ANSI::113722::US::CI LABS::Apple:TestClock:Presentation:Synchronize";
- const ODType kAlarmSettingsFrame = "+//ISO 9070/ANSI::113722::US::CI LABS::Apple:TestClock:Presentation:AlarmSettings";
- const ODType kDisplaySettingsFrame = "+//ISO 9070/ANSI::113722::US::CI LABS::Apple:TestClock:Presentation:DisplaySettings";
- const ODType kDialogFrame = "+//ISO 9070/ANSI::113722::US::CI LABS::Apple:TestClock:Presentation:Dialog";
-
- // Command IDs
-
- const ODCommandID cSynchronize = 20001;
- const ODCommandID cShowAlarmSettings = 20002;
- const ODCommandID cShowDisplaySettings = 20003;
- const ODCommandID cAnalog = 20004;
- const ODCommandID cDigital = 20005;
- const ODCommandID cNewView = 20006;
- const ODCommandID cNewFloater = 20007;
- const ODCommandID cNewSinker = 20008;
- const ODCommandID cNewMenu = 20009;
- const ODCommandID cDeleteMenu = 20010;
-
-
- // private error codes:
-
- const ODError kODErrCannotAcquireWindow = 71;
-
- //=========================================================================
- // Function Prototypes
- //=========================================================================
-
- void CheckMarkMenu(MenuHandle menu, Str255 checkItem, ODBoolean checkIt);
- void StyleToString(ODUByte style, Str255* styleName );
-
- //=========================================================================
- // Clock Globals
- //=========================================================================
-
- class ClockGlobals
- {
- public:
- ClockGlobals();
- ~ClockGlobals();
- void InitClockGlobals(Environment* ev, ODSession* session, ODPart* part);
- void AcquireGlobals(Environment* ev);
- void ReleaseGlobals(Environment* ev);
- void FreeGlobals(Environment* ev);
-
- ODSession* GetSession(Environment* ev);
- void CreateDisplaySettingsDialog(Environment* ev, ODFrame* sourceFrame);
- void OpenDisplaySettingsDialog(Environment* ev, ODFrame* sourceFrame);
- void CloseDisplaySettingsWindow(Environment* ev);
- void CreateAlarmSettingsDialog(Environment* ev, ODFrame* sourceFrame);
- void OpenAlarmSettingsDialog(Environment* ev, ODFrame* sourceFrame);
- void CloseAlarmSettingsWindow(Environment* ev);
-
-
-
- void AcquiringFocus(Environment* ev, ODFrame* toFrame);
- void SuspendWindows(Environment* ev, ODBoolean processChange);
- void ResumeWindows(Environment* ev, ODBoolean processChange);
- void RemovingFrame(Environment* ev, ODFrame* frame);
-
- void AddDialogFrame(Environment* ev, ODFrame* frame);
- void RemoveDialogFrame(Environment* ev, ODFrame* frame);
- void AdjustDialogs(Environment* ev);
-
- short fRefCount;
- ODSession* fSession;
- ODMenuBar* fMenuBar;
-
- ODID fDisplaySettingsWindow;
- DialogPtr fDispaySettingsDialog;
- ODID fAlarmSettingsWindow;
- DialogPtr fAlarmSettingsDialog;
- ODTypeToken fFrameView;
- ODTypeToken fDisplaySettingsPresentation;
- ODTypeToken fAlarmSettingsPresentation;
- OrderedCollection* fDialogFrames;
- };
-
- #endif // _CLOCKGBL_
-